<template>
    <h1>{{ title }}</h1>
    <button @click="handleClick">显示</button>
    <com-dialog v-if="showDialog" @handleCancel="handleCancel" @handleOk="handleOk" width="500" :dialogStyle="'height:500px'">1232</com-dialog>
</template>

<script setup lang="ts">
import com from "./com.vue";
import { useRoute } from "vue-router";
import { ref } from "vue";

const route = useRoute();

const title = ref("appComponent");

if (route.meta && route.meta.title) {
    title.value = route.meta.title as string;
}

const showDialog = ref(false);

const handleClick = () => {
    showDialog.value = true;
};
const handleCancel = () => {
    showDialog.value = false;
};
const handleOk = () => {
    showDialog.value = false;
};
</script>

<style scoped></style>
